Release 10.1A: OpenEdge Data Management:
SQL Development
Using inner joins
An inner join produces a results table consisting of only those rows that correspond to the tables specified in the query. A query expression can specify inner joins in either its
FROMclause or itsWHEREclause.The syntax for an inner join is:
FROM table_ref CROSS JOIN table_refThis syntax is equivalent to omitting the
WHEREclause and a search condition.FROM table_ref [ INNER ] JOIN table_ref ON search_condition
FROM table_ref, table_ref WHERE search_conditionSpecify search_condition for restricting rows that will be in the result table generated by the join. In the first format,
INNERis optional and has no effect. There is no difference between theWHEREform of inner joins and theJOIN ONform.This is the syntax for a
where_clause_inner_join:
Queries in Example 6–10 illustrate the results of a simple
CROSS JOINoperation and an equivalent formulation that does not use theCROSS JOINsyntax.
The following join is used to retrieve customer and customer order data:
The statement produces the results table shown in Example 6–11.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |